---
import BlinkWhale from "./BlinkWhale.astro"
import EmailSignup from "./EmailSignup.astro"
const menuSections = [
  {
    title: "Products",
    items: [
      {
        url: "https://app.union.build",
        name: "App",
      },
      {
        url: "https://app.union.build/dashboard",
        name: "Dashboard",
      },
    ],
  },
  {
    title: "Resources",
    items: [
      {
        url: "https://docs.union.build",
        name: "Docs",
      },
      {
        url: "https://research.union.build",
        name: "Research",
      },
      {
        url: "https://drive.google.com/file/d/11BawNxXch9xX8aRJl0ZqDAb925NjDuHH/view",
        name: "Whitepaper",
      },
      {
        url: "/brand-kit",
        name: "Brand kit",
      },
      {
        url: "https://status.union.build/",
        name: "Status",
      },
      {
        url: "https://github.com/unionlabs/union",
        name: "GitHub",
      },
    ],
  },
  {
    title: "About",
    items: [
      {
        url: "/blog",
        name: "Blog",
      },
      {
        url: "/team",
        name: "Team",
      },
      {
        url: "/ecosystem",
        name: "Ecosystem",
      },
    ],
  },
  {
    title: "Social",
    items: [
      {
        url: "https://x.com/union_build",
        name: "X.com",
      },
      {
        url: "https://discord.union.build",
        name: "Discord",
      },
      {
        url: "https://www.youtube.com/@union_build",
        name: "YouTube",
      },
      {
        url: "https://www.linkedin.com/company/union-labs/",
        name: "LinkedIn",
      },
    ],
  },
  {
    title: "Legal",
    items: [
      {
        url: "/privacy-policy",
        name: "Privacy Policy",
      },
      {
        url: "/terms-of-service",
        name: "Terms of Service",
      },
      {
        url: "/mica-whitepaper",
        name: "MiCA Whitepaper",
      },
    ],
  },
]

function isInternal(menuItem: { url: string }): boolean {
  return menuItem.url[0] === "/"
}
---

<footer class="bg-neutral-950 border-t-2 border-neutral-800 font-jetbrains justify-center flex flex-col font-normal items-center gap-4 p-4 mt-16">
  <ul class="grid grid-cols-2 sm:grid-cols-3 md:grid-cols-5 gap-12 list-none py-4">
    {
      menuSections.map((menuSection) => (
        <li>
          <h3 class="font-supermolot text-lg font-bold uppercase !m-0 !p-0">
            {menuSection.title}
          </h3>
          {
            menuSection.items.map((menuItem) => (
              <div>
                <a
                  href={menuItem.url}
                  target={isInternal(menuItem) ? "" : "_blank"}
                  rel={isInternal(menuItem) ? "" : "noopener noreferrer"}
                  class="text-normal !text-white !no-underline"
                >
                  {menuItem.name}
                </a>
              </div>
            ))
          }
        </li>
      ))
    }
  </ul>
  <EmailSignup />

  <p class="text-center block font-bold mt-4 font-supermolot text-accent-500">
    <BlinkWhale />
  </p>
  <p class="text-center font-supermolot font-bold block text-neutral-500 my-4">
    &copy; Union Labs
  </p>
</footer>
